package top.greatxiaozou.adapterPattern;

public class AudioPlayer implements MediaPlayer {
    private Adapter adapter;

    @Override
    public void play(String type, String fileName) {
        if (type.equals("mp3")) {
            System.out.println("the player is playing mp3 file " + fileName);
        } else {
            adapter = new Adapter(type);
            adapter.play(type, fileName);
        }
    }
}
